/*
#include <qwebframe.h>
#include <qwebview.h>

#include "codeedit.h"
#include "visualedit.h"

VisualEdit::VisualEdit(const int &visualMode, QWidget *parent) : QStackedWidget(parent) {
  CodeEdit *c = new CodeEdit;
  __v[0] = addWidget(c);

  QWebView *w = new QWebView;
  w->page()->setContentEditable(true);
  __v[1] = addWidget(w);

  connect(c, SIGNAL(textChanged()), this, SLOT(codeTextChanged()));
  connect(w->page()->mainFrame()->page(), SIGNAL(contentsChanged()), this, SLOT(visualTextChanged()));

  if(visualMode == Code) {
    setCurrentIndex(__v[0]);
  } else {
    setCurrentIndex(__v[1]);
  }
}

int VisualEdit::currentVisualMode(void) {
  if(currentIndex() == __v[1]) {
    return Visual;
  }

  return Code;
}

bool VisualEdit::isModified(void) {
  if(currentIndex() == __v[0]) {
    return visualEdit()->page()->isModified();
  } else {
    return codeEdit()->document()->isModified();
  }
}

bool VisualEdit::isRedoAvailable(void) {
  if(currentIndex() == __v[0]) {
    return false;
  } else {
    return codeEdit()->document()->isRedoAvailable();
  }
}

bool VisualEdit::isUndoAvailable(void) {
  if(currentIndex() == __v[0]) {
    return false;
  } else {
    return codeEdit()->document()->isUndoAvailable();
  }
}

int VisualEdit::selectedTextLength(void) {
  return codeEdit()->textCursor().selectedText().length();
}

void VisualEdit::setCurrentVisualMode(const int &visualMode) {
  if(visualMode == Visual) {
    setCurrentIndex(__v[1]);
  } else {
    setCurrentIndex(__v[0]);
  }
}

void VisualEdit::setText(const QString &text) {
  codeEdit()->setText(text);
  visualEdit()->setHtml(text);
}

void VisualEdit::codeTextChanged(void) {
  if(currentIndex() == __v[0]) {
    visualEdit()->setHtml(codeEdit()->toPlainText());
  }

  emit textChanged();
}

void VisualEdit::visualTextChanged(void) {
  if(currentIndex() == __v[1]) {
    codeEdit()->setText(visualEdit()->page()->mainFrame()->toHtml());
  }

  emit textChanged();
}

CodeEdit *VisualEdit::codeEdit(void) {
  return (CodeEdit*)widget(__v[0]);
}

QWebView *VisualEdit::visualEdit(void) {
  return (QWebView*)widget(__v[1]);
}
*/
